﻿@{
    ViewBag.Title = "RptDawOutAccount";
}
@section scripts
{
    <script src="@Url.Content("~/Scripts/shared/share.js")" type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/shared/shown.js")" type="text/javascript"></script> 
    <link href="~/Scripts/miniui/themes/default/medium-mode.css" rel="stylesheet" type="text/css" />      
    <script src="@Url.Content("~/Scripts/common/export.js")" type="text/javascript"></script>
}
    @Html.Partial("~/Views/Modular/ReportsToolbar.cshtml")
        <table style="margin-bottom:4px;">
            <tr>
            <td width ="50px" align="right">日期：</td>
            <td width ="310px">
                 @Html.Partial("~/Views/Modular/dxDateRange.cshtml")
            </td>
            <td width ="70px" align="right" >分店名称：</td>
            <td width ="150px">
                 @Html.Partial("~/Views/Delivery/LookupStockRelevant.cshtml")
            </td>
            <td width="70px" height ="40px" align="right">收款项目：</td>
            <td width="200px" height ="40px">
                @Html.Partial("~/Views/Modular/LookupPayItemOut.cshtml")
            </td>
            </tr>
        </table> 

    <div class="mini-fit">
     <div id="datagrid1" class="mini-datagrid" style="width:100%;height:100%;"  showPager = "true"
                borderStyle="border:1;"pageSize="15"  url="../Report/GetBillList"
                allowCellSelect="true" allowCellEdit="true" fitColumns="false">
            <div property="columns">
                <div type="checkcolumn" ></div>      
                <div type="indexcolumn" width="40" headerAlign="center" >序号</div>
                <div field="FDate" name="FDate" width="80" headeralign="center" allowsort="true" dateFormat="yyyy-MM-dd">日期</div>
                <div field="FBillNo" name="FBillNo" width="130" headeralign="center" allowsort="true">结算单号</div>
                <div field="FNumber" name="FNumber" width="80" headeralign="center" allowsort="true">分店编码</div>
                <div field="FName" name="FName" width="120" headeralign="center" allowsort="true">分店名称</div>
                <div field="FOutAmount" name="FOutAmount" width="80" headeralign="center" align="right" allowsort="true" numberFormat="#,0.00">应收金额</div>
                <div field="FGetAmount" name="FGetAmount" width="80" headeralign="center" align="right" allowsort="true" numberFormat="#,0.00">已收金额</div>
                <div field="FBalanceAmt" name="FBalanceAmt" width="80" headeralign="center" align="right" allowsort="true" numberFormat="#,0.00">期末结存</div>
                <div field="FPayItemName" name="FPayItemName" width="100" headeralign="center" allowsort="true">收款项目</div>
                <div field="FUserName" name="FUserName" width="80" headeralign="center" allowsort="true">经办人</div>   
                <div field="FExplanation" name="FExplanation" width="120" headeralign="center" allowsort="true">摘要</div>                             
            </div>
       </div>  
    </div>

<script>
    mini.parse();
    function FormShown() {
        var toDay = new Date();
        mini.getbyName("FDate1").setValue(toDay);
        mini.getbyName("FDate2").setValue(toDay);
    }
    $(function () {
        LoadData();
    });
    function LoadData() {
        var sSystemAppID = parent.window.getSystemAppID();
        var json = "[{";
        json = json + "'mSystemAppID':" + "'" + sSystemAppID + "',";
        json = json + "'FDate1':'" + mini.getbyName("FDate1").getFormValue() + " 00:00:00',";
        json = json + "'FDate2':'" + mini.getbyName("FDate2").getFormValue() + " 23:59:59',";
        json = json + "'FCustID':'" + mini.getbyName("FRStockID").getValue() + "',";
        json = json + "'FPayItemID':'" + mini.getbyName("FPayItemNumber").getValue() + "',";
        json = json + "'mListType':'" + getQueryString("datatype") + "'}]";
        var grid = mini.get("datagrid1");
        grid.load({ mydata: json });
        mExportDataUrl = grid.url;
        mExportDataJson = json;//导出
    }
    function search() {
        LoadData();
    }
    function printdata() {
        var grid = mini.get("datagrid1");
        var url = "../Report/PrintReport";
        mini.open({
            url: url,
            title: "打印", width: 1000, height: 700,
            onload: function () {
                var iframe = this.getIFrameEl();
                var NoneDisplayCol = [0];
                iframe.contentWindow.InitalPrint(grid, NoneDisplayCol, "客户对帐表");
            }
        });
    }
    function clearloca() {
        mini.getbyName("FRStockID").setValue('');
        mini.getbyName("FRStockID").setText('');
        mini.getbyName("FRStockName").setValue('');
        var nowDate = new Date();
        mini.getbyName("FDate1").setValue(nowDate);
        mini.getbyName("FDate2").setValue(nowDate);
        mini.getbyName("comdatasel").setValue(0);
    }
</script>


